#include <bits/stdc++.h>
using namespace std;

map<string, int> mp;
string change(string s) {
  string ss = s;
  int len = s.size();
  for (int i = 0; i < len; i++) {
    // tolower(s[i]);
    if (s[i] >= 'A' && s[i] <= 'Z') {
      ss[i] = ss[i] + ('a' - 'A');
    }
  }
  return ss;
}

// 完美的方案
void change2(string &s) {

  int len = s.size();
  for (int i = 0; i < len; i++) {
    // tolower(s[i]);
    if (s[i] >= 'A' && s[i] <= 'Z') {
      s[i] = s[i] + ('a' - 'A');
    }
  }
}

int main() {

  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string word;
    cin >> word;
    string ss = change(word); // 转小写
    // transform(word.begin(), word.end(), word.begin(), ::tolower);
    // mp[word] = mp[word] + 1; // 统计每个单词的次数
    mp[ss] = mp[ss] + 1; // 统计每个单词的次数
  }
  int leizhu = 0;
  string name;

  /*   for (auto it = mp.begin(); it != mp.end(); it++) {
      if (it->second > leizhu) {
        leizhu = it->second;
        name = it->first;
      }
    }

  */

  for (auto [k, v] : mp) {
    if (v > leizhu) {
      leizhu = v;
      name = k;
    }
  }
  cout << name;

  return 0;
}